<!doctype html>
<html>
    <head>
      <meta charset="UTF-8"/>
	    <link rel="stylesheet" type="text/css" href="/webapp/css/easyui.css">
	    <link rel="stylesheet" type="text/css" href="/webapp/css/icon.css">
        <link rel="stylesheet" type="text/css" href="/webapp/css/color.css">
        <link rel="stylesheet" type="text/css" href="/webapp/css/public.css">
	    <script type="text/javascript" src="/webapp/js/lib/jquery.min.js"></script>
	    <script type="text/javascript" src="/webapp/js/lib/jquery.easyui.min.js"></script>
	    <script type="text/javascript" src="/webapp/js/lib/ajaxfileupload.js"></script>
	    <script type="text/javascript" src="/webapp/js/common/config.js"></script>
    </head>
    <body>
    	   <div class="easyui-container-fluid">          
              <div class="easyui-panel" style="border: none;">
                  <div id="nav" class="nav"></div>
                  <div class="easyui-panel" style="border: none">
                      <form id="upload-form">
                        <input type="file" id="uploadfile" name="uploadfile" style="with:100%;"/>
                        <input type="number" class="easyui-numberspinner" data-options="precision:2"/>
                      </form>
                    </div>
                    <div style="margin-top:20px;">
                      <a id="btn-upload" href="javascript:void(0);" class="easyui-linkbutton" style="width:80px;">upload</a>
                    </div>
                </div>
         </div>
    </body>
    <script type="text/javascript">
         
         $(function(){
               $("#btn-upload").on("click",function(e){
                   $.ajaxFileUpload({
                       url:config.url + "/upload/action",
                       secureuri:true,
                       crossDomain:true,
                       fileElementId:"uploadfile",
                       xhrFields:{withCredentials:true},
                       dataType:"json",
                       success:function(data,status){
                           console.log(data);
                       },
                       error:function(data,status,error){
                           console.log("upload fail");
                       }
                   });
               });
               setNav();
         });
    </script>
     
</html>
